package com.cnfilm.web.links;

import java.util.List;

import com.cnfilm.utils.CacheManager;
import com.jfinal.plugin.activerecord.Model;

/**
 * Links model.
 */
@SuppressWarnings("serial")
public class Links extends Model<Links> {
	
	public static final Links dao = new Links();
	
	@SuppressWarnings("unchecked")
	public static List<Links> getAllLinks(){
		String key = "cache_getAllLinks";
		List<Links> cList = null;
		boolean hasCache = CacheManager.hasCache(key);
		if (hasCache) {
		  cList = (List<Links>)CacheManager.getCache(key);
	    } else {
	       cList = Links.dao.find("select * from links order by id asc");
		   CacheManager.putCache(key, cList);  
	    }
		return cList;
	}
	
}